package org.juggers.domain;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * @author <a href="mailto:nicolas@breizhjug.org">Nicolas De loof</a>
 * @author <a href="mailto:michel@breizhjug.org">Michel DAVID</a>
 */
@Entity( name = "org.juggers.domain.UserGroup" )
public class UserGroup
    extends AbstractEntity
{

    private static final long serialVersionUID = -1709288173860370002L;

    @Id
    @GeneratedValue( strategy = GenerationType.IDENTITY )
    private Long id;

    private String name;

    private String site;

    private String logo;

    private Collection<Long> leadersId;

    private String contactEMail;

    /**
     * @return the id
     */
    public Long getId()
    {
        return this.id;
    }

    /**
     * @param id the id to set
     */
    public void setId( Long id )
    {
        Long oldValue = this.id;
        this.id = id;
        firePropertyChange( "id", oldValue, id );
    }

    /**
     * @return the name
     */
    public String getName()
    {
        return this.name;
    }

    /**
     * @param name the name to set
     */
    public void setName( String name )
    {
        String oldValue = this.name;
        this.name = name;
        firePropertyChange( "name", oldValue, name );
    }

    /**
     * @return the site
     */
    public String getSite()
    {
        return this.site;
    }

    /**
     * @param site the site to set
     */
    public void setSite( String site )
    {
        String oldValue = this.site;
        this.site = site;
        firePropertyChange( "site", oldValue, site );
    }

    /**
     * @return the logo
     */
    public String getLogo()
    {
        return this.logo;
    }

    /**
     * @param logo the logo to set
     */
    public void setLogo( String logo )
    {
        String oldValue = this.logo;
        this.logo = logo;
        firePropertyChange( "logo", oldValue, logo );
    }

    /**
     * @return the leadersId
     */
    public Collection<Long> getLeadersId()
    {
        return this.leadersId;
    }

    /**
     * @param leaders the leadersId to set
     */
    public void setLeaders( Collection<Long> leadersId )
    {
        Collection<Long> oldValue = this.leadersId;
        this.leadersId = leadersId;
        firePropertyChange( "leadersId", oldValue, leadersId );
    }

    /**
     * @return the contactEMail
     */
    public String getContactEMail()
    {
        return this.contactEMail;
    }

    /**
     * @param contactEMail the contactEMail to set
     */
    public void setContactEMail( String contactEMail )
    {
        String oldValue = this.contactEMail;
        this.contactEMail = contactEMail;
        firePropertyChange( "contactEMail", oldValue, contactEMail );
    }

    // Fonzie methods
    public native void persist() /*-{

    }-*/;

    public native void refresh() /*-{

    }-*/;

    public native UserGroup merge() /*-{

    }-*/;

    public native void remove() /*-{

    }-*/;

    public native static Collection<UserGroup> findAll() /*-{

    }-*/;

    public native static UserGroup findById( Long id ) /*-{

    }-*/;
}
